<template>
  <div>
     <h3>测试题</h3>
     <div>
      <MySubject
      v-for="(item,index) in arr"
      :key="index"
      :obj="item"
      @tijiao="item.result=$event">
      </MySubject>
     </div>
     <div>
      <MyFlag v-for="(item,index) in arr" :key="index" :obj="item" :index="index"></MyFlag>
      </div>
   </div>
</template>
 
<script>
import MySubject from "./components/MySubject.vue"
import MyFlag from "./components/MyFlag.vue"
export default {
  components: {
    MySubject,
    MyFlag,
  },
  props: {},
  data() {
    return {
      arr:[]
    };
  },
  computed: {},
  watch: {},
  created() {
    const arr=[]
    for (let i=0;i<5;i++){
        const left = Math.floor(Math.random()*11);
        const right = Math.floor(Math.random()*11);
        arr.push({left,right,result:null});
   }
   this.arr=arr
  },
  methods: {}
};
</script>

<style scoped>
     
</style>